package com.umeng.soexample.mvc.view.helper;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.Toast;

import com.umeng.soexample.R;
import com.umeng.soexample.mvc.control.SPHelperSave;
import com.umeng.soexample.mvp.view.HomeActivity;

public class HelperActivity extends AppCompatActivity implements View.OnClickListener {

    private Button btn_helper_women;
    private Button btn_helper_men;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_helper);
        initView();
    }

    private void initView() {
        btn_helper_women = (Button) findViewById(R.id.btn_helper_women);
        btn_helper_men = (Button) findViewById(R.id.btn_helper_men);

        btn_helper_women.setOnClickListener(this);
        btn_helper_men.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_helper_women:
                Toast.makeText(this, "去一边去没写", Toast.LENGTH_SHORT).show();
                break;
            case R.id.btn_helper_men:
                toMain();
                break;
        }
    }

    /**
     * 跳转到主页面
     */
    private void toMain() {

        /**
         * 存储已经进过引导页
         */
        SPHelperSave.getInstance().setLogin(true);
        /**
         * 跳转到主页
         */
        Intent intent = new Intent(HelperActivity.this, HomeActivity.class);
        startActivity(intent);
        finish();
    }
}
